// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#ifndef LINEGLYPHATTRIBUTES_H
#define LINEGLYPHATTRIBUTES_H
#include <state_exports.h>
#include <string>
#include <AttributeSubject.h>


// ****************************************************************************
// Class: LineGlyphAttributes
//
// Purpose:
//    Attributes for line glyphs
//
// Notes:      Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//
// ****************************************************************************

class STATE_API LineGlyphAttributes : public AttributeSubject
{
public:
    enum LineType
    {
        Line,
        Tube,
        Ribbon
    };
    enum EndPointStyle
    {
        None,
        Spheres,
        Cones
    };
    enum SizeType
    {
        Absolute,
        FractionOfBBox
    };

    // These constructors are for objects of this class
    LineGlyphAttributes();
    LineGlyphAttributes(const LineGlyphAttributes &obj);
protected:
    // These constructors are for objects derived from this class
    LineGlyphAttributes(private_tmfs_t tmfs);
    LineGlyphAttributes(const LineGlyphAttributes &obj, private_tmfs_t tmfs);
public:
    virtual ~LineGlyphAttributes();

    virtual LineGlyphAttributes& operator = (const LineGlyphAttributes &obj);
    virtual bool operator == (const LineGlyphAttributes &obj) const;
    virtual bool operator != (const LineGlyphAttributes &obj) const;
private:
    void Init();
    void Copy(const LineGlyphAttributes &obj);
public:

    virtual const std::string TypeName() const;
    virtual bool CopyAttributes(const AttributeGroup *);
    virtual AttributeSubject *CreateCompatible(const std::string &) const;
    virtual AttributeSubject *NewInstance(bool) const;

    // Property selection methods
    virtual void SelectAll();
    void SelectTubeRadiusVar();
    void SelectEndPointRadiusVar();

    // Property setting methods
    void SetLineType(LineType lineType_);
    void SetLineWidth(int lineWidth_);
    void SetTubeResolution(int tubeResolution_);
    void SetTubeRadiusSizeType(SizeType tubeRadiusSizeType_);
    void SetTubeRadiusAbsolute(double tubeRadiusAbsolute_);
    void SetTubeRadiusBBox(double tubeRadiusBBox_);
    void SetTubeRadiusVarEnabled(bool tubeRadiusVarEnabled_);
    void SetTubeRadiusVar(const std::string &tubeRadiusVar_);
    void SetTubeRadiusVarRatio(double tubeRadiusVarRatio_);
    void SetTailStyle(EndPointStyle tailStyle_);
    void SetHeadStyle(EndPointStyle headStyle_);
    void SetEndPointRadiusSizeType(SizeType endPointRadiusSizeType_);
    void SetEndPointRadiusAbsolute(double endPointRadiusAbsolute_);
    void SetEndPointRadiusBBox(double endPointRadiusBBox_);
    void SetEndPointResolution(int endPointResolution_);
    void SetEndPointRatio(double endPointRatio_);
    void SetEndPointRadiusVarEnabled(bool endPointRadiusVarEnabled_);
    void SetEndPointRadiusVar(const std::string &endPointRadiusVar_);
    void SetEndPointRadiusVarRatio(double endPointRadiusVarRatio_);

    // Property getting methods
    LineType          GetLineType() const;
    int               GetLineWidth() const;
    int               GetTubeResolution() const;
    SizeType          GetTubeRadiusSizeType() const;
    double            GetTubeRadiusAbsolute() const;
    double            GetTubeRadiusBBox() const;
    bool              GetTubeRadiusVarEnabled() const;
    const std::string &GetTubeRadiusVar() const;
          std::string &GetTubeRadiusVar();
    double            GetTubeRadiusVarRatio() const;
    EndPointStyle     GetTailStyle() const;
    EndPointStyle     GetHeadStyle() const;
    SizeType          GetEndPointRadiusSizeType() const;
    double            GetEndPointRadiusAbsolute() const;
    double            GetEndPointRadiusBBox() const;
    int               GetEndPointResolution() const;
    double            GetEndPointRatio() const;
    bool              GetEndPointRadiusVarEnabled() const;
    const std::string &GetEndPointRadiusVar() const;
          std::string &GetEndPointRadiusVar();
    double            GetEndPointRadiusVarRatio() const;

    // Persistence methods
    virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
    virtual void SetFromNode(DataNode *node);

    // Enum conversion functions
    static std::string LineType_ToString(LineType);
    static bool LineType_FromString(const std::string &, LineType &);
protected:
    static std::string LineType_ToString(int);
public:
    static std::string EndPointStyle_ToString(EndPointStyle);
    static bool EndPointStyle_FromString(const std::string &, EndPointStyle &);
protected:
    static std::string EndPointStyle_ToString(int);
public:
    static std::string SizeType_ToString(SizeType);
    static bool SizeType_FromString(const std::string &, SizeType &);
protected:
    static std::string SizeType_ToString(int);
public:

    // Keyframing methods
    virtual std::string               GetFieldName(int index) const;
    virtual AttributeGroup::FieldType GetFieldType(int index) const;
    virtual std::string               GetFieldTypeName(int index) const;
    virtual bool                      FieldsEqual(int index, const AttributeGroup *rhs) const;

    // User-defined methods
    bool ChangesRequireRecalculation(const LineGlyphAttributes &) const;

    // IDs that can be used to identify fields in case statements
    enum {
        ID_lineType = 0,
        ID_lineWidth,
        ID_tubeResolution,
        ID_tubeRadiusSizeType,
        ID_tubeRadiusAbsolute,
        ID_tubeRadiusBBox,
        ID_tubeRadiusVarEnabled,
        ID_tubeRadiusVar,
        ID_tubeRadiusVarRatio,
        ID_tailStyle,
        ID_headStyle,
        ID_endPointRadiusSizeType,
        ID_endPointRadiusAbsolute,
        ID_endPointRadiusBBox,
        ID_endPointResolution,
        ID_endPointRatio,
        ID_endPointRadiusVarEnabled,
        ID_endPointRadiusVar,
        ID_endPointRadiusVarRatio,
        ID__LAST
    };

private:
    int         lineType;
    int         lineWidth;
    int         tubeResolution;
    int         tubeRadiusSizeType;
    double      tubeRadiusAbsolute;
    double      tubeRadiusBBox;
    bool        tubeRadiusVarEnabled;
    std::string tubeRadiusVar;
    double      tubeRadiusVarRatio;
    int         tailStyle;
    int         headStyle;
    int         endPointRadiusSizeType;
    double      endPointRadiusAbsolute;
    double      endPointRadiusBBox;
    int         endPointResolution;
    double      endPointRatio;
    bool        endPointRadiusVarEnabled;
    std::string endPointRadiusVar;
    double      endPointRadiusVarRatio;

    // Static class format string for type map.
    static const char *TypeMapFormatString;
    static const private_tmfs_t TmfsStruct;
};
#define LINEGLYPHATTRIBUTES_TMFS "iiiiddbsdiiiddidbsd"

#endif
